

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

appBar(String title,{ backButton = const BackButton(color: Colors.black),List<Widget>? actions}){
  return AppBar(
    // 明暗模式：light
    brightness: Brightness.light,
    // title位置：居中
    centerTitle: true,
    // 阴影高度：0
    elevation: 0,
    // 背景色：白色
    backgroundColor: Colors.white,
    // 导航栏最左侧Widget：是否显示返回按钮
    leading: backButton,
    // 导航栏右侧List<Widget>
    actions: actions,
    // title文字和样式
    title: Text(
      title,
      style: const TextStyle(
        fontSize: 18,
        color: Colors.black,
        fontWeight: FontWeight.bold,
      ),
    ),
  );
}
materialPage({Key? key,AppBar? appBar,@required Widget? page}){
  return MaterialApp(
    builder: (context,widget){
      return Scaffold(
        key: key,
        appBar:appBar,
        body: page,
      );
    },
  );
}